asm-lsp/samples/z80.s
Will Lillis 181681708c
Add Z80 Support (#59)
* First pass Z80 register xml file

Hover support for Z80 registers

Remove extraneous semicolons

Short Z80 register descriptions

Initial commit for z80 instructions xml and its generator.
Co-authored-by: gilbertfrancois <>

Checkpoint commit, sketching out z80 data structs

Appease clippy

Chore: Update opcodes (#40)

* Chore: Update opcodes xml files

* Update parser for updated xml files

Cleaning up

More clean up, syncing up with master branch

Simplifying things...

Most z80 features working, need to polish instruction hover support

Hover display tweaks, correct URL escaping, formatting

Z80 documentation now opens at correct section

Initial work on instruction descriptions

Instruction descriptions done

Z80 Signature Help support

Fix logic bug for file word grab

* Cleanup
2024-06-29 11:34:24 -04:00

16 lines
738 B
ArmAsm

; Taken from page 53 of the manual https://www.zilog.com/docs/z80/z80cpu_um.pdf
LD HL, DATA ;STARTING ADDRESS OF DATA STRING
LD DE, BUFFER ;STARTING ADDRESS OF TARGET BUFFER
LD B', 132 ;MAXIMUM STRING LENGTH
LD A, '$' ;STRING DELIMITER CODE
LOOP:
CP (HL) ;COMPARE MEMORY CONTENTS WITH
;DELIMITER
JR Z, END-$ ;GO TO END IF CHARACTERS EQUAL
LDI ;MOVE CHARACTER (HL) to (DE)
;INCREMENT HL AND DE, DECREMENT BC
JP PE, LOOP ;GO TO "LOOP" IF MORE CHARACTERS
END: ;OTHERWISE, FALL THROUGH
;NOTE: P/V FLAG IS USED
;TO INDICATE THAT REGISTER BC WAS
;DECREMENTED TO ZERO.