Skip to content

Commit c6e7670

Browse files
committed
Add Db, Dw.
1 parent 42fa42e commit c6e7670

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

langs/a86/ast.rkt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@
250250
(instruct Const (x) check:label-symbol)
251251

252252
;; IMPROVE: do more checking
253+
(instruct Db (x) (lambda (a x n) (values a x)))
254+
(instruct Dw (x) (lambda (a x n) (values a x)))
253255
(instruct Dd (x) (lambda (a x n) (values a x)))
254256
(instruct Dq (x) (lambda (a x n) (values a x)))
255257

langs/a86/printer.rkt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@
234234
" equ "
235235
(number->string c))]
236236

237+
[(Db x)
238+
(string-append tab "db " (arg->string x))]
239+
[(Dw x)
240+
(string-append tab "dw " (arg->string x))]
237241
[(Dd x)
238242
(string-append tab "dd " (arg->string x))]
239243
[(Dq x)

www/notes/a86.scrbl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,14 @@ Perform bitwise not operation (each 1 is set to 0, and each 0 is set to 1) on th
15841584
]
15851585
}
15861586

1587+
@defstruct*[Db ([d integer?])]{
1588+
Psuedo-instruction for declaring 8-bits of initialized static memory.
1589+
}
1590+
1591+
@defstruct*[Dw ([d integer?])]{
1592+
Psuedo-instruction for declaring 16-bits of initialized static memory.
1593+
}
1594+
15871595
@defstruct*[Dd ([d integer?])]{
15881596
Psuedo-instruction for declaring 32-bits of initialized static memory.
15891597
}

0 commit comments

Comments
 (0)