2019-11-15 08:59:26 -05:00
|
|
|
.equ foo 456 ; AFTER_ORG should not get that value
|
|
|
|
.org 0x1234
|
|
|
|
.equ AFTER_ORG @
|
|
|
|
.org 0
|
|
|
|
|
2019-05-28 15:56:39 -04:00
|
|
|
jp test
|
|
|
|
|
2019-12-23 15:41:25 -05:00
|
|
|
.inc "ascii.h"
|
|
|
|
.inc "core.asm"
|
|
|
|
.inc "lib/ari.asm"
|
|
|
|
.inc "lib/fmt.asm"
|
|
|
|
.inc "stdio.asm"
|
|
|
|
.inc "common.asm"
|
|
|
|
|
2019-11-14 21:16:36 -05:00
|
|
|
dummyLabel:
|
2019-05-28 15:56:39 -04:00
|
|
|
|
2019-11-14 21:16:36 -05:00
|
|
|
.equ dummyLabel 0x42
|
|
|
|
|
2019-05-28 15:56:39 -04:00
|
|
|
test:
|
|
|
|
ld hl, 0xffff
|
|
|
|
ld sp, hl
|
|
|
|
|
2019-06-04 11:53:02 -04:00
|
|
|
; *** Just little z80 flags memo.
|
|
|
|
and a ; clear carry
|
|
|
|
ld hl, 100
|
|
|
|
ld de, 101
|
|
|
|
sbc hl, de
|
|
|
|
jp nc, fail ; carry is set
|
|
|
|
call nexttest
|
|
|
|
|
|
|
|
and a ; clear carry
|
|
|
|
ld hl, 101
|
|
|
|
ld de, 100
|
|
|
|
sbc hl, de
|
|
|
|
jp c, fail ; carry is reset
|
|
|
|
call nexttest
|
|
|
|
|
|
|
|
ld a, 1
|
|
|
|
dec a
|
|
|
|
jp m, fail ; positive
|
|
|
|
dec a
|
|
|
|
jp p, fail ; negative
|
|
|
|
call nexttest
|
|
|
|
|
2019-11-14 21:16:36 -05:00
|
|
|
; Test that .equ can override label
|
2019-12-23 15:41:25 -05:00
|
|
|
ld de, 0x42
|
2019-11-14 21:16:36 -05:00
|
|
|
ld hl, dummyLabel
|
2019-12-23 15:41:25 -05:00
|
|
|
call assertEQW
|
2019-11-14 21:16:36 -05:00
|
|
|
call nexttest
|
|
|
|
|
2019-11-15 08:59:26 -05:00
|
|
|
; test that "@" is updated by a .org directive
|
|
|
|
ld hl, AFTER_ORG
|
|
|
|
ld de, 0x1234
|
2019-12-23 15:41:25 -05:00
|
|
|
call assertEQW
|
2019-05-31 11:12:29 -04:00
|
|
|
call nexttest
|
|
|
|
|
2019-12-13 22:49:15 -05:00
|
|
|
; test that AND affects the Z flag
|
|
|
|
ld a, 0x69
|
|
|
|
and 0x80
|
2019-12-23 15:41:25 -05:00
|
|
|
call assertZ
|
2019-12-13 22:49:15 -05:00
|
|
|
call nexttest
|
|
|
|
|
2019-05-28 15:56:39 -04:00
|
|
|
; success
|
|
|
|
xor a
|
|
|
|
halt
|
|
|
|
|
2019-12-23 15:41:25 -05:00
|
|
|
STDIO_RAMSTART:
|