diff --git a/Assembly-program-examples.md b/Assembly-program-examples.md index b321336..53015aa 100644 --- a/Assembly-program-examples.md +++ b/Assembly-program-examples.md @@ -233,4 +233,24 @@ FLOPPY_WRITE_SECTOR equ 3 ; Cost: 1kJ ;; 1440 sectors of 512 words. (total 1,474,560 bytes / 737,280 words / 1.44MB) ;; Read and write operations are synchronous. Track seeking time is 2ms.* ;; *Seek time is added to the total execution time, which is not yet calculated as of v1.3a +``` + +Dump memory to disk +```assembly +HWID_FLOPPY equ 0xB + +;************************************** +;* dumpMemToDisk() +;* Dump entire memory to Floppy Disk +dumpMemToDisk: + MOV X, 0 + MOV Y, 0 +dumpMemToDiskLoop: + MOV A, 3 ; WRITE_SECTOR + HWI HWID_FLOPPY + ADD X, 1 + ADD Y, 512 + CMP X, 128 + JNZ dumpMemToDiskLoop + RET ``` \ No newline at end of file