flat assembler
Message board for the users of flat assembler.

Index > DOS > LABELIST an.ASM w/Line numbers & SRC code

Author
Thread Post new topic Reply to topic
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 14 Jun 2025, 16:56
LABELIST beta version is getting a REWRITE. be back soon.........


Last edited by bitdog2u on 27 Jun 2025, 18:52; edited 2 times in total
Post 14 Jun 2025, 16:56
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1717
Location: Toronto, Canada
AsmGuru62 15 Jun 2025, 00:36
Nice utility.
I think a good IDE should do the work like that.
Internally, it makes a map of all source code with labels and procedures.
Post 15 Jun 2025, 00:36
View user's profile Send private message Send e-mail Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1169
Location: Russia
macomics 15 Jun 2025, 05:00
You're missing an important macro.
AFILE.MAC
Code:
macro FSEEK Fhand, Offs, From {
  mov DX, Offs AND 00000FFFFh
  mov CX, ( Offs AND 0FFFF0000h ) SHR 010h
  mov AX, 04200h + ( From AND 03h )
  int 021h
}    


CODE.INC
Code:
_17: MOV        DX,':R'         ; DH='R' DL=':'
_18: MOV        BX,0x0A20       ; BH=10  BL=32
...
_22: CMP        AL,'.'  ; skip local labels
...
_24: CMP        AL,';'  ; skip comments
...
_27: CMP        AL,BL
...
_30: CMP        AL,DL   ; ':' check 4 a label
...
_32: CMP        AL,BL   ; check for below 33
...
_41: CMP        AL,DL   ; ':' check 4 the label marker
...
_53: CMP        AL,BH           ; EOL
...
_55: CMP        AL,BL           ; 32
...
_57: CMP        AL,DH           ; 'R' I always use upper case RET.    

You transfer money from one pocket to another. For AX/AL, there are three-two-byte comparison commands with IMMEDIATE and there is no need to overload registers with constants. It won't run faster than the constants in the instruction code.

Code:
LODSB    

If you are writing under DOS, then it is better to use this version of this instruction (available in FASM) so as not to get confused with the segments.
Code:
LODS BYTE [DS:SI]    


LABELIST.ASM
Code:
        MOV     AL,[80h]        ; get ARGC input count
        CMP     AL,3            ; ARGC > 3 ok, (PSP cmnd line input count byte)
        JA      noEER2
inCNT:  CALL    POPEER          ; PUSH MSG adr, JMP, print, Exit ErroR
MSG02   DB 13,10,"Command line input count error. ARGC 4-104=ok.$"
noEER2: CMP     AL,104          ; Over 100 and PSP data is overwritten ?
        JA      inCNT    
Where did you get 104 from? The buffer for the command line can safely hold 127 bytes (125 bytes without taking into account the initial space and the ending 0Dh).
https://en.wikipedia.org/wiki/Program_Segment_Prefix wrote:
80h 1 byte Number of bytes on command-line
81h–FFh 127 bytes Command-line tail (terminated by a 0Dh)[4][5]


Code:
_321:
GiFLp0: LODSB   ; skip over any STARTING spaces
        CMP     AL,DL   ;32
        JZ      GiFLp0
...
_334: LOOP      GiFLp1    
This loop knocks down your string length counter in CX. Either modify it (add the DEC CX command), or go from the character counter to the end-of-line address and compare SI=CX.

I don't have time to look for blemishes and mistakes anymore.
Post 15 Jun 2025, 05:00
View user's profile Send private message Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 15 Jun 2025, 08:41
AsmGuru62
It's FREE WARE my friend. You can have the code in your program, cut/paste, take my name out, USE THE IDEA, It's all good.
IN AN IDE it could be a JUMP TABLE you click on, LIKE A MENU.
I altered a TED.asm text editor to have A JUMP TABLE 1-9
ALT+1 set the address of the CURSOR
CTRL+1 jumped to the address. I jump all over at will.
Then I made a JT.com that would search a file and find ~
Since it was a character I never used, JT would log the address of 12 ~
to the boot stack at 0000:0300h and my TED would use those as pre sets.
Then I could quit the editor and they were still set when I came back. SO
i would use 1-5 for one program and 6-9 for the other.
IT WAS REAL HANDY but it didn't update the address as the file expanded or shrank. BUT
an update LABELS BUTTON would fix them all at once.
Just a thought for the pondering.
Post 15 Jun 2025, 08:41
View user's profile Send private message Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 15 Jun 2025, 10:42
macomics
Thanks, that was more than I expected. I was kinda wanting to know if my programs ran in a DOS BOX, on what OS, type stuff, & DID IT ASSEMBLE, cuz some times I leave out files or they are included with a path, so it would assemble for me but not you. Then First impression, BIG learning curve ?, easy instructions. Could be useful info. Can I use the code in my what ever? Yack like that, but you actually did some work. Thanks. I'll look over your post closer. Your right I left out an important macro, LOTS OF THEM, MOST ALL OF THEM, cuz I was commenting on some ones post for FILE READ/WRITE CODE so I posted aFILE.ZIP for their specific needs, then it got 47 downloads in a couple days so I gathered up the rest of my macros and UPLOADED FILEMAC.ZIP which has FSEEKm and 17 more macro's. It is a post down from the aFILE.ZIP you were looking at.

You say, It won't run faster than the constants in the instruction code.
I didn't know that. I found an 8088 in the garbage dumpster and used it for years to check code speed as I was learning to write assembly and was under the impression that REGISTERS transferred info faster than constants. Then lately, I changed thinking to, IT'S ALREADY SO FAST THAT THE PROGRAM IS DONE before I can get my finger off the ENTER KEY so what does it matter anyway. Freeing up the registers is best also. If it works, it really doesn't matter.
So I take it that you have a great timer, and have ran a series of MOV AL, ? instructions in a compound loop to get billions of MOV's so you can actually tell the difference between MOV AL,AH and MOV AL,13 as far as speed goes. Other wise you are choosing to believe the unproven and looking for fault in others, UNWARRANTEDLY. But you wouldn't do that, so what was the result of your speed tests ?

You have a nice writing style and know your FASM coding better than I for sure
LODS BYTE [DS:SI] ;looks good
My LODSB is such old tech, that already knows DS: is attached to SI and assembles to DB 172 ;just like yours does and is easier to write.
Sorry I wasted your time that way.

YEP the 104 bytes is short of the 127 available, but way back when I made this program, I was using the PSP as an unused variable data area.
So just before ORG 100h you can see there is a series of define an ADRs that eat up 22 bytes + 105 = 127 byte DTA in PSP.
Then I found out that area is not always ZEROed out. Then next time it was ZEROed out, so I gave up on PSP and started overwriting USE ONCE CODE AREA'S for variables. But the code works and IF SOMEONE had some info on the command line input buffer usage, I'm all ears.



GiFLp0: LODSB ; skip over any STARTING spaces
CMP AL,DL ;32
JZ GiFLp0
...
_334: LOOP GiFLp1
This loop knocks down your string length counter in CX. Either modify it (add the DEC CX command), or go from the character counter to the end-of-line address and compare SI=CX.
I don't have time to look for blemishes and mistakes anymore.

You are absolutely right, EXCEPT FOR, it is doing what it is suppose to do. CX is not a loop counter it is a LOOP LIMITER.
The exit code is when AL=13 ENTER at the end of the command line.
I have never had any problems with the code in years.
People input total crap like all spaces, but GIFNAMES worst case senerio is that it returns a bad FILE name that won't FOPENRm, and BYEpop dumps out the BAD inFILE NAME, error message & BYE: = EXIT.
It's not my fault they put in a bad name, but they get the error message and a second try.
I've tried running it like a SWEET SIXTEEN who's daddy gets her a car and cell phone for altering her report card.
AND it just seems to hold up better than 10 Trained professionals trying to keep Joe Biden on his feet.

Thanks for your time.

PS, Did it work for you? Do you think it might be useful? What OS? In a BOX? Did it assemble? Missing pieces? Does the LGBTQ community like it?
Post 15 Jun 2025, 10:42
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1169
Location: Russia
macomics 15 Jun 2025, 14:21
bitdog2u wrote:
I didn't know that. I found an 8088 in the garbage dumpster and used it for years to check code speed as I was learning to write assembly and was under the impression that REGISTERS transferred info faster than constants... But you wouldn't do that, so what was the result of your speed tests ?

This will already work faster, but on a 386+ processor.
Initially, simply placing information in registers accelerated execution because for reading (especially the 8088 with an 8-bit data bus, which the 8086 had a 16-bit one), it was forced to generate extra cycles of reading from memory for each instruction. When placing data for commands in registers, they became shorter and this gave an acceleration. But short commands with constants are provided for the accumulator, and using AX/AL, you can get better performance and free up space in registers simply by using these short commands (they will not contain modr/m bytes).

It was only with the advent of the first pipelines and superscalar technology that the final registers lost their rigid location in the processor. Now the processor spends time searching for the right register and commands with constants work faster, even using modr/m bytes for encoding.

Code:
cmp al, 3 ; 0C3h 003h
; and
cmp al, bl ; 038h 0C3h ; both are 2 bytes long -> 2 bus cycles for 8088 & 1 bus cycle for 8086
; however
cmp bl, 3 ; 080h 0CBh 003h ; one byte longer -> 3 bus cycles for 8088 & 2 bus cycles for 8086
; On the i386, this optimization (and maybe already on the i286) does not have any effect.    


bitdog2u wrote:
Did it work for you? Do you think it might be useful? What OS? In a BOX? Did it assemble? Missing pieces?

1) Not tested, just reading sources.
2) No. At least i586 code may be useful. x86_64 is better.
3) I can try to build it under Linux, but there may be problems with the case in the file names.
4) Under DOSBOX and on VirtualBox/QEMU.
5) Checking it out.

ADD:
bitdog2u wrote:
EXCEPT FOR, it is doing what it is suppose to do. CX is not a loop counter it is a LOOP LIMITER.
The exit code is when AL=13 ENTER at the end of the command line.

The final 00Dh does not count towards the length of 080h
Post 15 Jun 2025, 14:21
View user's profile Send private message Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 15 Jun 2025, 17:11
Thanks AsmGuru62
I'll see you around, my friend.

PS, I think I coded with you on programmers' heaven decades ago.
You da man and haven't changed.
Maybe I'll see you over there soon.
Post 15 Jun 2025, 17:11
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1717
Location: Toronto, Canada
AsmGuru62 15 Jun 2025, 21:08
Well, thank you for recalling the PH times, some nostalgia there!
Now, I am usually only around this forum --- getting old, I guess.
From your posts, it seems that MS-DOS is your main attention.
I once wanted to make an IDE for MS-DOS which would help to write FASM code, but then it somehow got stale.
At the end of 80s I coded so much for DOS using TASM, at my job, I might add.
Post 15 Jun 2025, 21:08
View user's profile Send private message Send e-mail Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 15 Jun 2025, 23:15
AsmGuru62
I just get attacked here, but I'm a FASM man and that won't change soon.
This forum works so well I don't want to leave but I'm looking for a new Home now.
I've got Dozens of cool programs to unload, but where?
I got nothing but hate here, except for you, revolution and Picnic, I hate to lose you guys.
Post 15 Jun 2025, 23:15
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1717
Location: Toronto, Canada
AsmGuru62 16 Jun 2025, 11:52
bitdog
I think you are exaggerate about "hate".
It was just a normal exchange about things.
Besides, you can ignore stuff like that, a very useful skill.
I mean, do not leave the great forum just because of some criticism, and it was not that harsh, no names were used.
Post 16 Jun 2025, 11:52
View user's profile Send private message Send e-mail Reply with quote
Mat Qua sar



Joined: 13 Jun 2025
Posts: 35
Mat Qua sar 16 Jun 2025, 12:27
bitdog2u wrote:

I've got Dozens of cool programs to unload, but where?


Last edited by Mat Qua sar on 17 Jun 2025, 07:00; edited 3 times in total
Post 16 Jun 2025, 12:27
View user's profile Send private message Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 16 Jun 2025, 22:57
AsmGuru62
Yes, yes, and yes. + a couple more, &
i'm regrouping now.
Post 16 Jun 2025, 22:57
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1436
Location: Piraeus, Greece
Picnic 17 Jun 2025, 17:39
I’m with AsmGuru62 on this.
bitdog2u, if you ever felt wronged or something bothered you, just try to move past it.
Keep only the kind and constructive criticism. You've brought a fresh breeze to the DOS section in no time and that's amazing.
Please keep sharing your work.

I still remember the useful things I discovered in your "fasmenv.zip".

And from posts by Matrix, bitRAKE, LocoDelAssembly, Revolution, vid...
I may have commented on a few things, but most of the time I never did.
I just learned quietly from all of it (as much as I could), and I’m still learning.

To me, all the content on these forum pages is a real treasure.
I see fasm and this forum as deeply connected, the forum is part of fasm’s strength.
And to me, that’s one of the quiet marks of genius in Tomasz’s work.

In the end, the forum is its members.
Post 17 Jun 2025, 17:39
View user's profile Send private message Visit poster's website Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 19 Jun 2025, 18:41
AsmGuru62, Picnic, I tried to help a low class friend. He stole from me and when forced to return the item, he poisoned my drinking water supply. Then I find out that my X turned my daughter into the kind of low life scum that I can't be around. Along with the other 3 SCUM PROBLEMS I'm living now, then there is this.
I couldn't get beta testers here or any real input, I got to fight the Russian/Ukraine war by people HUNGRY to find some fault in my code and tell me to throw my code in the garbage, I kept posting their errors, hoping they would realize their mistake and stop, but when they grouped & SHIT on my post by changing the subject to their HEX DUMP, I had enough. Good thing you are smart enough to know, there is no virus in my code.
The .asm assembles FC.exe =to the.com & there is no hex dump or picture included to hide a virus in. But dummies deleted my.ZIPs & now I can only release, FINISHED VERSIONS. But I can't ever seem to finish something, so don't hold your breath for my next upload. My email adr is in one of those .ZIPs but it's all lower case, bitdog2u@ so look it up and lets communicate.
Post 19 Jun 2025, 18:41
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1436
Location: Piraeus, Greece
Picnic 20 Jun 2025, 18:38
Hey there,

Thanks for sharing your thoughts.
It sounds like you've been through a lot, both personally and in your coding journey.
I can see you’ve put serious effort into your work, and it's frustrating when that’s met with criticism or misunderstanding.

Don’t let the negative voices drown out your motivation.
Keep building at your own pace (those who get it, will appreciate it).

Wishing you better experiences ahead.

Take care.
Post 20 Jun 2025, 18:38
View user's profile Send private message Visit poster's website Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 42
bitdog2u 25 Jun 2025, 20:15
Hello Picnic, I got a wild hair and worked on a RAND number maker and checker. The checker inputs a file of ASCII random numbers output by a rand maker, and sorts them, removes duplicates and marks each one with the OCCURRENCE COUNT
and missing numbers are also marked. So you can easily check your RAND making code.
Then the Rand maker uses a few bad versions of code by others, just to get it started here.
DO YOU THINK THERE IS ANY INTEREST ?
Is there a RAND POST already, or should I start a NEW POST ?
I'm still working on that part.

PS, I use FASM .ASM to escape the problems of life, so I don't totally lose my FAITH IN HUMANITY,
I just got a dose of reality here, and now I can't post anything unless it's cleaned up & finished.
In the old days of Programmers Heaven, a post would get 5 helpers quick, so I got spoiled I guess.

PS2, I made a RAND maker, that puts out a rand # 0-100 without missing any numbers and does no duplicates.
But it's not random, it's the appearance of random.
Post 25 Jun 2025, 20:15
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.