Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.msdos.programmer > #3225
| From | Rod Pemberton <invalid@lkntrgzxc.com> |
|---|---|
| Newsgroups | comp.os.msdos.programmer |
| Subject | Re: scan for a-z |
| Date | 2019-04-02 18:03 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <q80m3b$1m9j$2@gioia.aioe.org> (permalink) |
| References | <ja45aepid2pe3kgka19s1011br325ph479@4ax.com> <c227f968-52f0-4285-8b73-2f13343c9016@googlegroups.com> <alpine.BSF.2.02.1904021237040.63863@frieza.hoshinet.org> <ic47aede9ffq719atu7kbiikaemr0ecokr@4ax.com> |
On Tue, 02 Apr 2019 16:48:41 +0000
T. Ment <t.ment@protocol.invalid> wrote:
> On Tue, 2 Apr 2019 12:40:41 -0400, Steve Nickolas wrote:
> >Now, I don't speak 8086 asm, so bear with me, because I'm going to
> >use the only dialect I know - 6502. But the logic would probably be
> >the same as 8086.
> >
> >ptr = $04
> >entry: ldy #$00
> >@1: lda (ptr), y
> > beq @3
> > cmp #'a'
> > bcc @2 ; less than
> > cmp #'z'+1
> > bcs @2 ; greater or equal
> > and #$5F
> > sta (ptr), y
> >@2: iny
> > bne @1
> >@3: rts
>
> I have no knowledge of 6502. If anyone can translate to 8086, please
> do.
It's been a long time since I did 6502. But, roughly translated ...
entry: cld
mov esi,[ptr] ; ptr contains address of buffer
mov edi,esi
add edi,length_of_buffer+1
@1: lodsb
or al,al ; set flags
jz @3 ; nul terminated buffer/string
cmp al,'a'
jb @2
cmp al,'z'+1
jae @2
and al,5Fh
dec esi
stosb
@2: cmp esi,edi
jne @1
@3: ret
For x86, XLATB is a better solution, since the "complicated" 6502
indirect addressing modes don't exist on x86.
http://qcd.phys.cmu.edu/QCDcluster/intel/vtune/reference/vc327.htm
Rod Pemberton
--
The lesson for Boeing. You push the nose of a plane down, and planes
go down.
Back to comp.os.msdos.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
scan for a-z T. Ment <t.ment@protocol.invalid> - 2019-04-01 22:43 +0000
Re: scan for a-z "Alexei A. Frounze" <alexfrunews@gmail.com> - 2019-04-01 21:04 -0700
Re: scan for a-z T. Ment <t.ment@protocol.invalid> - 2019-04-02 16:31 +0000
Re: scan for a-z Steve Nickolas <usotsuki@buric.co> - 2019-04-02 12:40 -0400
Re: scan for a-z T. Ment <t.ment@protocol.invalid> - 2019-04-02 16:48 +0000
Re: scan for a-z Rod Pemberton <invalid@lkntrgzxc.com> - 2019-04-02 18:03 -0400
Re: scan for a-z Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> - 2019-04-17 23:56 +1000
Re: scan for a-z "R.Wieser" <address@not.available> - 2019-04-02 09:00 +0200
Re: scan for a-z "Kerr-Mudd,John" <notsaying@invalid.org> - 2019-04-02 09:06 +0000
Re: scan for a-z "R.Wieser" <address@not.available> - 2019-04-02 14:37 +0200
Re: scan for a-z Herbert Kleebauer <klee@unibwm.de> - 2019-04-02 12:39 +0200
Re: scan for a-z "Kerr-Mudd,John" <notsaying@invalid.org> - 2019-04-02 14:27 +0000
Re: scan for a-z Herbert Kleebauer <klee@unibwm.de> - 2019-04-02 20:17 +0200
Re: scan for a-z "Kerr-Mudd,John" <notsaying@invalid.org> - 2019-04-02 19:16 +0000
Re: scan for a-z wolfgang kern <nowhere@never.at> - 2019-04-03 16:13 +0200
Re: scan for a-z T. Ment <t.ment@protocol.invalid> - 2019-04-03 19:36 +0000
Re: scan for a-z "Kerr-Mudd,John" <notsaying@invalid.org> - 2019-04-04 14:43 +0000
Re: scan for a-z wolfgang kern <nowhere@never.at> - 2019-04-05 00:41 +0200
Re: scan for a-z JJ <jj4public@vfemail.net> - 2019-04-02 19:53 +0700
Re: scan for a-z Mateusz Viste <mateusz@cant.remember> - 2019-04-02 13:00 +0000
Re: scan for a-z T. Ment <t.ment@protocol.invalid> - 2019-04-02 16:44 +0000
Re: scan for a-z Rod Pemberton <invalid@lkntrgzxc.com> - 2019-04-02 18:04 -0400
Re: scan for a-z "Kerr-Mudd,John" <notsaying@invalid.org> - 2019-04-03 09:31 +0000
Re: scan for a-z "Alexei A. Frounze" <alexfrunews@gmail.com> - 2019-04-03 02:48 -0700
Re: scan for a-z "Kerr-Mudd,John" <notsaying@invalid.org> - 2019-04-03 12:25 +0000
Re: scan for a-z Rod Pemberton <invalid@lkntrgzxc.com> - 2019-04-03 18:05 -0400
Re: scan for a-z Bogus@Embarq.com (Steve) - 2019-04-03 11:58 +0000
Re: scan for a-z wolfgang kern <nowhere@never.at> - 2019-04-03 15:58 +0200
Re: scan for a-z wolfgang kern <nowhere@never.at> - 2019-04-03 16:05 +0200
Re: scan for a-z "R.Wieser" <address@not.available> - 2019-04-03 17:40 +0200
Re: scan for a-z "R.Wieser" <address@not.available> - 2019-04-03 17:47 +0200
csiph-web