News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Seeming duplication ?

Started by bobl, October 22, 2009, 07:20:17 AM

Previous topic - Next topic

sinsi

heh, if the code runs on an 8088/8086 then opcode 0Fh was legit (pop cs). Now, 0Fh is the first part of a sh*tload of 286+ stuff  :bdg
Light travels faster than sound, that's why some people seem bright until you hear them.

MichaelW

Quoteif the code runs on an 8088/8086 then opcode 0Fh was legit

I have no way to verify if the instruction would execute (I think Dave does), but I can verify that MASM will not accept POP CS. Even with the default processor (.8086), MASM 5.1 returns:

error A2059: Illegal use of CS register
eschew obfuscation

sinsi

Try MASM 1.25 - that does it OK (I used that version for 10 years, even on my 486 - that's why I hate macros, since I had to write so many).
I'll try and dig it up and check.
Light travels faster than sound, that's why some people seem bright until you hear them.

sinsi

My mistake, although I'm sure it is a legal opcode (the symmetry thing)

The Microsoft MACRO Assembler , Version 1.25         
Copyright (C) Microsoft Corp 1981,82,83

0000  0F                       start: pop cs
E r r o r   --- 59:CS register illegal usage     

Warning Severe
Errors Errors
0 1

But see, it encodes it as 0F. Who has an 808x to test it on?
Light travels faster than sound, that's why some people seem bright until you hear them.

MichaelW

I think dedndave has a PC XT that still works.
eschew obfuscation

dedndave

you can't pop CS without a valid IP to go with it - lol
certainly, you can push CS
the 8088 has no tests for invalid opcodes - it generates no exceptions
it will execute whatever you put in front of it
that's why you can do things like AAM 9 to divide by 9
the opcode for AAM is D4 0A
with the 8086, you can put other values where the 0A is and it works - lol
but - don't expect MASM to do it for you - you have to hard-code it

        db 0D4h,9    ;AAM 9

so - if you were to POP CS, there has to be valid code at the new CS:IP, or it will crash, of course

EDIT - i just fired up the old XT - lol
dang - the monitor is dead - no high voltage
it worked the last time i fired it up
the XT seems to boot, but the hard drive sounds like a bearing with no oil - lol
it is an old 40 MB seagate drive - it always was loud

FORTRANS

Quote from: dedndave on October 24, 2009, 11:31:28 AM
you can't pop CS without a valid IP to go with it - lol
Sure you can.  Not that that is a good thing.
Quote
certainly, you can push CS
the 8088 has no tests for invalid opcodes - it generates no exceptions
it will execute whatever you put in front of it
that's why you can do things like AAM 9 to divide by 9
the opcode for AAM is D4 0A
with the 8086, you can put other values where the 0A is and it works - lol
It works on other processors as well.  But yes, you need to
hard code it.  I've seen it in binary to hexadecimal conversion.

   Back to POP CS, eek!  It works on my 80186...  DEBUG
doesn't decode it though. It shows as DB 0F.

Cheers,

Steve

FORTRANS

Quote from: dedndave on October 24, 2009, 11:31:28 AM
EDIT - i just fired up the old XT - lol
dang - the monitor is dead - no high voltage
it worked the last time i fired it up
the XT seems to boot, but the hard drive sounds like a bearing with no oil - lol
it is an old 40 MB seagate drive - it always was loud

Hi,

   Is that monitor MDA or CGA?  If CGA you can use a TV set.
Ah yes, Seagate drives.  I may have to see if I can get the
video back on my 8088.  Opposite problem from you, good
monitor here.

Cheers,

Steve N.

dedndave

hiya Steve - lol
yah - it has composite output, but i don't feel like messing with it at the moment - too many other things to deal with right now
i will fix the monitor later, hopefully - if not, i think i have another CGA monitor out in the shed
otherwise, i have a bunch of old "super vga" cards around that are XT compatible and several monitors i can use with them

FORTRANS

HI Dave,

   If you are capable of fixing high voltage circuits, I should probably
stop saying simpler things as advice.  Somehow I ended up with a
CGA card, though I never had a system with one in it.  I would go
with a SVGA myself rather than a CGA, but if you want one...

   Oh the POP CS comment was in error.  CS sure changed, but
due to an interrupt.  Mea culpa, for not double checking until
after posting.

Oops,

Steve

hutch--

 :bg

I remember that CGA text mode on a good VGA screen used to look great and was instant fast. All of the decent development environments back then, MASM, MS-C and even quick basis ran in CGA text mode. You actually felt like you were typing into a computer, not one of the late GUI things. I have in an archive on te machine, my ancient development tools and they still run like rockets.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

lol - np Steve
when i was a kid, my dad ran a tv repair business out of the basement
i was his "free employee" (i.e. slave) at a very young age
i learned electronics along the way - especially tv and radio circuits
i also put up hundreds of tv antennas and towers - in fact, i saved dad's ass from falling off a roof at about age 10
you don't know how many times i have pondered whether i should have let him, the antenna, and the rotor all drop - lol
but, yah - i can fix hv circuits - in fact, there aren't very many circuits i can't fix if i have the tools/equipment/parts/time
when i got out of the army, i went into computers and other digital circuits
after that, dad was the student