•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 455,973 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,819 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser: Programming Forums
Views: 884 | Replies: 5
![]() |
•
•
Join Date: Nov 2007
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
Hey people.
I'm trying to build a loop to move from Arthur Vandelay to Tim Pennypacker, to Bob Sacamano. I know how to move from 54 to 21 to -2 and so on but I can't get the code right to move from Arthur Vandelay to Tim Pennypacker. I know it's something simple that I'm missing but the online documentation is scarce.
Much appreciated.
I'm trying to build a loop to move from Arthur Vandelay to Tim Pennypacker, to Bob Sacamano. I know how to move from 54 to 21 to -2 and so on but I can't get the code right to move from Arthur Vandelay to Tim Pennypacker. I know it's something simple that I'm missing but the online documentation is scarce.
Emp1 db 'Arthur Vandelay',13,10,'$' Num1 dw 54,21,-2,25 db 'Tim Pennypacker',13,10,'$' dw 24,81,-14,22 db 'Bob Sacamano',13,10,'$' dw 72,-9,-51,-22
Much appreciated.
Last edited by art vandelay : Nov 25th, 2007 at 11:39 pm.
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,539
Reputation:
Rep Power: 40
Solved Threads: 972
why don't you make it easy on yourself and give each one a name like you did Emp1 == use Emp2, Emp3, etc. Then I think you can create a jump table
table dw Emp1, Emp2, Emp3
•
•
Join Date: Feb 2005
Location: 55 26'N 118 46'W
Posts: 184
Reputation:
Rep Power: 4
Solved Threads: 13
Based on your example and because you have variable length records SCASB is your best option
Now you are pointing to the numeric values and you just have to add 8 to edi to point to the next employee.
Although this does work, it is very problematic. Fixed record lengths or pointers via a table as Ancient Dragon has pointed out are the best way s to go.
asm Syntax (Toggle Plain Text)
mov edi, Emp1 mov al, '$' xor ecx, ecx dec ecx repnz scasb
Now you are pointing to the numeric values and you just have to add 8 to edi to point to the next employee.
Although this does work, it is very problematic. Fixed record lengths or pointers via a table as Ancient Dragon has pointed out are the best way s to go.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Assembly Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- assembly simple games(Nasm) (Assembly)
- Simple array question (C++)
- Simple algorithm question/needed (Java)
- Need help with basic assembly calculator (Assembly)
- Simple Class Question (C++)
- simple msn question (Windows Software)
- C++ handling of strings in a boolean expression (C++)
- Simple (I think) Code Question (PHP)
Other Threads in the Assembly Forum
- Previous Thread: Two dimensional Arrays in MIPS
- Next Thread: Sparc Assembly Help!



Linear Mode