1 ; The classic game of Nibbles
2 ; Written by Ian Seyler
5 ; nasm argtest.asm -o argtest.app
7 ; Game field is surrounded by a border. Play area is 38 x 23
10 [ORG 0x0000000000200000]
14 start: ; Start of program label
19 mov rdi
, os_screen
; Screen framebuffer
23 rep stosd ; Draw the top wall
26 nextside: ; Draw the side walls
35 rep stosd ; Draw the bottom wall
37 call b_screen_update
; Copy the screen buffer to video memory
42 cmp byte [direction
], 1
44 cmp byte [direction
], 2
46 cmp byte [direction
], 3
48 cmp byte [direction
], 4
75 call b_input_key_check
89 mov byte [direction
], 1
93 mov byte [direction
], 4
97 mov byte [direction
], 3
101 mov byte [direction
], 2
106 mov ax, 0x0018 ; Set the hardware cursor to the bottom left-hand corner
109 call b_show_statusbar
114 direction: db 2 ; 1 up, 2 right, 3 down, 4 left
116 os_screen: equ 0x0000000000180000 ; This is the address for the text screen frame buffer. It gets copied to video memory via b_update_screen