Alright so, basically I have to create a program in assembly that will call a menu procedure to display a two line menu:
"c" - to continue
"x" - to quit
Then it will get one of those keys from the user, ignoring any others. If it's x, then it'll quit, otherwise if it's c, then I call a third procedure named display. That procedure just prints out the number 10 and returns.
Here's what I have so far:
Quote (Makefile)
TARGET = menu
AFILES = main.asm\
menu.asm\
display.asm
#Don’t modify below this line:
include /usr/local/include/project.mak
Quote (main.asm:)
%include “/usr/local/include/asm_io.inc
section .text
global asm_main
extern menu
asm_main:
call fib_menu
ret
Quote (menu.asm:)
global menu
extern display
section .data
menuInfo db "c - to continue",10
"x - to quit”,10,0
menu:
push rbp
mov rbp, rsp
mov rdi, menuInfo
call print_string
mov R8, 10
push R8
call display
pop R8
mov RDI, R9
call print_string
mov rsp, rbp
pop rbp
ret
Quote (display.asm:)
global display
display:
push rbp
mov rbp, rsp
;;;DISPLAY CODE HERE
mov R9, ;SOMETHING
mov rsp, rbp
pop rbp
ret
I think I have the general format right, I just have no idea how I would keep looping and displaying 10 until the user presses X.
Any thoughts/ideas?
This post was edited by Rejection on Mar 9 2014 11:56am