Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CALL / RET ... is that implemented ? #19

Open
oscarys opened this issue May 12, 2023 · 2 comments
Open

CALL / RET ... is that implemented ? #19

oscarys opened this issue May 12, 2023 · 2 comments

Comments

@oscarys
Copy link

oscarys commented May 12, 2023

Hi,

I try to compile perfectly valid code with a procedure call, but I get this weird message:

Syntax Error at 27:0 : call f1 : 'call' can be only used with procedures, f1 is not a procedure

I wonder how does the emulator determines that 'f1' is not a procedure, when it is a valid label in my code:

f1: 
push bp
mov  bp, sp
mov ax, ax
pop bp
ret

Moreover, I note that in the web app, bp is not syntax-highlighted, which is strange and makes me think of some implementation lacking.

Any clarifications are highly appreciated.

@oscarys oscarys changed the title CALL / RET ... is that implemented CALL / RET ... is that implemented ? May 12, 2023
@oscarys
Copy link
Author

oscarys commented May 15, 2023

Oh,never mind .... I should have read syntax.md instead of assuming things. If anyone falls with this stone, this the way to declare a procedure:

def f1{
push bp
mov bp, sp
mov ax, ax
pop bp
ret}

@YJDoc2
Copy link
Owner

YJDoc2 commented May 15, 2023

Hey @oscarys , Apologies for not replying earlier 😓
As you have already found out, the way to write procedures is intentionally different. You cannot simply CALL any label, instead it needs to be defined as a procedure using def.

As for the syntax highlighting of bp, we are simply using react-syntax-highlighter and react-ace packages with their defaults for assembly. I'll try to work out if this is any issue from our side in setting them up, but if not, we can't really do much about it 😅

Again, apologies for late reply.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants