Compare commits
3 Commits
a8bf6749b8
...
34b11aabe5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34b11aabe5 | ||
|
|
767453bd55 | ||
|
|
df8e04ce63 |
@@ -526,3 +526,70 @@ hlt
|
|||||||
|
|
||||||
0xF4 ; HLT
|
0xF4 ; HLT
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### program output with the function `print`, each comma-seperated `db` value put onto its own line
|
||||||
|
|
||||||
|
editted output of `x/512xb 0x00070000` in [gdb](https://www.sourceware.org/gdb/)
|
||||||
|
|
||||||
|
the following is somewhat correct! I just need to a) null-terminate 8-byte chars and b) define all the addresses currently represented as `0xff 0xff 0xff 0xff`
|
||||||
|
|
||||||
|
```
|
||||||
|
0x48 0xff 0xf2
|
||||||
|
0x48 0xff 0xf0
|
||||||
|
0x48 0xff 0xf6
|
||||||
|
0xc7 0xc2 0xf8 0x03 0x00 0x00
|
||||||
|
0x8a 0x06
|
||||||
|
0x80 0xf8 0x00
|
||||||
|
0x0f 0x84 0xff 0xff 0xff 0xff
|
||||||
|
0x66 0xee
|
||||||
|
0x48 0xff 0xc6
|
||||||
|
0xe9 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0x8f 0xc6
|
||||||
|
0x48 0x8f 0xc0
|
||||||
|
0x48 0x8f 0xc2
|
||||||
|
0xc3
|
||||||
|
0x48 0xff 0xf6
|
||||||
|
0xc7 0xc6 0xff 0xff 0xff 0xff
|
||||||
|
0xe8 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0x8f 0xc6
|
||||||
|
0xe9 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0xff 0xf6
|
||||||
|
0xc7 0xc6 0xff 0xff 0xff 0xff
|
||||||
|
0xe8 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0x8f 0xc6
|
||||||
|
0xe9 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0xff 0xf6
|
||||||
|
0xc7 0xc6 0xff 0xff 0xff 0xff
|
||||||
|
0xe8 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0x8f 0xc6
|
||||||
|
0xe9 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0xff 0xf6
|
||||||
|
0xc7 0xc6 0xff 0xff 0xff 0xff
|
||||||
|
0xe8 0xff 0xff 0xff 0xff
|
||||||
|
0x48 0x8f 0xc6
|
||||||
|
0xe9 0xff 0xff 0xff 0xff
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x33 0x36 0x6d 0x00 0x00 0x00 0x00
|
||||||
|
0x7b 0x44 0x45 0x42 0x55 0x47 0x5d 0x3a
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x30 0x6d 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x31 0x3b 0x33 0x31 0x6d 0x00 0x00
|
||||||
|
0x7b 0x45 0x52 0x52 0x4f 0x52 0x5d 0x3a
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x30 0x6d 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x31 0x3b 0x33 0x33 0x6d 0x00 0x00
|
||||||
|
0x5b 0x54 0x45 0x53 0x54 0x5d 0x3a 0x20
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x30 0x6d 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x31 0x3b 0x33 0x35 0x6d 0x00 0x00
|
||||||
|
0x5b 0x57 0x41 0x52 0x4e 0x5d 0x3a 0x20
|
||||||
|
0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x5b 0x30 0x6d 0x00 0x00 0x00 0x00 0x00
|
||||||
|
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
||||||
|
```
|
||||||
|
|||||||
@@ -1302,6 +1302,7 @@ get_opcode:
|
|||||||
.found:
|
.found:
|
||||||
shl eax, 4
|
shl eax, 4
|
||||||
mov dl, [esi + 8 + opcodes.by_id + eax]
|
mov dl, [esi + 8 + opcodes.by_id + eax]
|
||||||
|
and edx, 0xFF
|
||||||
mov al, [esi + 2 + opcodes.by_id + eax]
|
mov al, [esi + 2 + opcodes.by_id + eax]
|
||||||
and eax, 0xFF
|
and eax, 0xFF
|
||||||
ret
|
ret
|
||||||
@@ -1347,6 +1348,7 @@ get_reg_bits:
|
|||||||
; ------------------------------------------------------------------------------
|
; ------------------------------------------------------------------------------
|
||||||
|
|
||||||
tokenise:
|
tokenise:
|
||||||
|
mov rbp, rsp
|
||||||
; rdi -> current byte of program
|
; rdi -> current byte of program
|
||||||
xor eax, eax ; rax = number of tokens processed
|
xor eax, eax ; rax = number of tokens processed
|
||||||
xor edx, edx ; dl = current byte of program
|
xor edx, edx ; dl = current byte of program
|
||||||
@@ -1653,6 +1655,7 @@ tokenise:
|
|||||||
jmp .loop
|
jmp .loop
|
||||||
|
|
||||||
.break:
|
.break:
|
||||||
|
mov rsp, rbp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; state
|
; state
|
||||||
|
|||||||
Reference in New Issue
Block a user