-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.asm
58 lines (48 loc) · 1.62 KB
/
main.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
chput: equ &ha2
org &h4000
ROMheader: defb "AB"
defw execute
defw 0, 0, 0, 0, 0, 0
.newLine: defb 13, 10, 0
.doneString: defb "done", 13, 10, 0
;.doubleString: defb "+0.12343e-4", 0
;.doubleString: defb "-009.123456e-111", 0
;.doubleString: defb "0.124999", 0
;.doubleString: defb "2.99792458e8", 0
;.doubleString: defb "0.12343e-24", 0
.doubleString: defb "6.62607015e-34", 0
;.doubleString: defb ".7450580596923828125", 0
;.doubleString: defb "19.9345", 0
;.doubleString: defb "2.2299999999e-308", 0
; RAM details
RAM1start: equ &hc000
include "U8bit/printU8bit.asm" ; 0
RAM2start: equ RAM1end
include "16bit/print16bit.asm"
RAM3start: equ RAM2end
include "UInt64/UInt64.asm"
RAM4start: equ RAM3end
include "Double/Double.asm"
dac: equ RAM4end ; 8 bytes
arg: equ dac + 8 ; 8 bytes
execute:
ld hl, .doubleString
call .printString
ld hl, .newLine
call .printString
ld hl, .doubleString
call parseDoubleString
call initDouble
call printDoubleHex
call printDouble
ld hl, .doneString
call .printString
.done: jr .done
.printString:
ld a, (hl)
or a
ret z
call chput
inc hl
jr .printString
.filler: defs &h4000 - ($ - ROMheader)