Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .macro push 1
- st a ppm_save_a
- st b ppm_save_b
- st c ppm_save_c
- st d ppm_save_d
- st %1 ppm_sp_high
- ld b ppm_sp_low
- ldi c #-1
- add a
- st a ppm_sp_low
- ld a ppm_save_a
- ld b ppm_save_b
- ld c ppm_save_c
- ld d ppm_save_d
- .endmacro
- .macro pop 1
- st a ppm_save_a
- st b ppm_save_b
- st c ppm_save_c
- st d ppm_save_d
- ld b ppm_sp_low
- ldi c #1
- add a
- st a ppm_sp_low
- ld a ppm_sp_high
- st a ppm_load
- ld a ppm_save_a
- ld b ppm_save_b
- ld c ppm_save_c
- ld d ppm_save_d
- ld %1 ppm_load
- .endmacro
- jmp start
- .resb 256
- ppm_save_a: .resb 1
- ppm_save_b: .resb 1
- ppm_save_c: .resb 1
- ppm_save_d: .resb 1
- ppm_load: .resb 1
- ppm_sp_high: .resb 1
- ppm_sp_low: .db -1
- start: ldi a #1
- ldi b #2
- ldi c #3
- ldi d #4
- push a
- push b
- push c
- push d
- pop a
- pop b
- pop c
- pop d
- hlt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement