flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > numeric labels |
Author |
|
revolution 12 Apr 2012, 22:03
For BASIC programs the line numbers are only used in specific places (GOTO, GOSUB, etc.) but for assembly we have ambiguous situations:
Code: mov eax,10 ; is this a label or a constant? |
|||
12 Apr 2012, 22:03 |
|
shutdownall 12 Apr 2012, 22:20
Good hint.
In fact I need the labels only in the beginning of a line. For 30 GOTO 20 I would interprete the number 20 as number and not as label. So I have to prevent FASM for replacing numeric labels with addresses. Maybe that's why numeric labels are not supported. Anyway I will use it only in a BASIC section. Maybe find some easier solution. Let see tomorrow. |
|||
12 Apr 2012, 22:20 |
|
shutdownall 12 Apr 2012, 22:28
Anyway I want to use an autonumber feature and use code like this
Code: ;autolinenumber:start=100 ;autolinenumber:step=10 LET A=1 lp1: PRINT A GOTO lp1 which should be handled internally like Code: 100 LET A=1 110 PRINT A 120 GOTO 110 So I am not sure now what the best way to implement. |
|||
12 Apr 2012, 22:28 |
|
Enko 13 Apr 2012, 14:52
I never used basic on old systems, but I think numeric labels where designed because perhaps you coudnt't edit lines that was already writen.
So if you forgot a line, you just put: Code: 100 let a=1 120 goto 110 110 print a Now days, using alpha labels shouldn't be a problem. |
|||
13 Apr 2012, 14:52 |
|
shutdownall 13 Apr 2012, 20:38
I not use BASIC instructions for programming, I use it for compatibility to old software and old humans programming old style.
Anyway it's a funny adventure doing things like this. Vintage computing is quite popular. And is assembler programming in general not a little bit vintage ? |
|||
13 Apr 2012, 20:38 |
|
shutdownall 13 Apr 2012, 20:42
Enko wrote: I never used basic on old systems, but I think numeric labels where designed because perhaps you coudnt't edit lines that was already writen. Yes because editors were not available on all systems and used signifcantly more ressources than line based editing. I need compatibility for maybe loading existing programs and let the user change / add something. That's why numeric labels (or in this case use of line numbers) are a must. |
|||
13 Apr 2012, 20:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.