Questions tagged [assembly]

Assembly languages in general, of any architecture. Use with the particular processor’s tag as appropriate.

Filter by
Sorted by
Tagged with
3
votes
1answer
154 views

Why does the JSR operation not jump?

I am building a computer based on the 65C02S, and when stepping through the code, I see strange things happening. This is my code: SEI CLD LDX #$ff TXS JSR someRoutine ... This translates to this ...
6
votes
1answer
131 views

How did macro-instructions and indirect addressing interact in IBM's MAP/FAP assemblers?

The MAP and FAP assemblers for the IBM 709/7090/7094 had a nice macro facility. I was surprised by its power. (Actually, I guess it is possible that most macro processors at the time were as ...
5
votes
2answers
395 views

Was there an analog of local labels in the IBM assembly language?

In the assembly language used in Unix on DEC machines (PDP-11, VAX), one can use numerical labels and refer to them with suffixes "b" and "f" meaning "backwards" and &...
8
votes
1answer
380 views

Different handling of ASCII interpretation between ca65 and cl65

I stumbled upon a divergence in the ASCII upper case/lower case handling when using assembler and linker of the cc65 suite separately (I used cc65 V2.15 on Win10). For a test I made the following ...
6
votes
1answer
221 views

What could be the reason an `LD B, B` instruction was used in this busy loop?

The Game Boy game "Tetris" leaves a transmission interval of about a millisecond between bytes sent over the serial link, as suggested by the official Game Boy Programming Manual, to give ...
17
votes
2answers
1k views

Z80 to x86 asm translator?

8086 is source code compatible with 8080. Zilog Z80 extended Intel 8080 with: An enhanced instruction set including bit manipulation, block move, block I/O, and byte search instructions New IX and IY ...
4
votes
1answer
90 views

Why have both the ORG and LOC pseudo-operations in the SHARE/Symbolic/Fortran Assembly Programs for the IBM 704/709/7090/7094?

This is a fairly basic question, and I almost feel ashamed to ask it; I'm guessing it can be answered in a single sentence. There was a rather influential series of assemblers for some of IBM's ...
12
votes
2answers
1k views

How would I reliably detect the amount of RAM, including Fast RAM?

If I was to write an Amiga game, what would be the best/most reliable way to detect how much RAM is actually available? Looking at Action's Guide to AGA-Fixing!, he mentions Faulty Memory Detection: ...
6
votes
2answers
403 views

Does a defacto format exist for Commodore 64 SID music?

I first learned about tracker / mod music on my Amiga in the early 1990's. I remember fooling around with Protracker, listening to mods with Intuitracker, and coming to the realization that all those ...
93
votes
7answers
27k views

Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?

Reading the NESdev wiki page on CPU unofficial opcodes, I see a few games use an undocumented 2-byte NOP instuction in production: Puzznic, F-117A Stealth Fighter, and Infiltrator use $89 #i. Beauty ...
12
votes
1answer
1k views

Who are the people associated with Simula, Assembler and Fortran in this video?

I am watching a recording of a discussion panel ‘Unix50 - Unix Today and Tomorrow’, part of which contains Bjarne Stroustrup’s talk ‘From C to C++’, discussing the history of C++. At 20:46 there is a ...
6
votes
3answers
2k views

Z80 string iteration failing

First Z80 project after 6502, a simple looking piece of code giving me hard time. print_char is a working function which prints contents of A to the screen. My first issue is that the following code (...
10
votes
0answers
298 views

Assembler where output file was executable WHILE including the source code

I seem to remember using an assembler with the following interesting workflow: You'd write an assembly language file and assemble it. The output overwrote your source code by placing the executable ...
12
votes
3answers
2k views

What 8086 instructions accept REP?

I tried this code in my assembler, set to 16 bit mode: bits 16 rep mov ds, ax Surprisingly, no error was thrown. Is this even valid? Wasn't rep only supposed to work with string instructions? Is it ...
7
votes
2answers
478 views

Labels in cc65 inline assembler with #define macro

In general, it is possible to use inline assembler statements within C macros, for example #define toscreencode(C) (__AX__ = (C), \ asm("cmp #$60"),\ ...
2
votes
2answers
313 views

How to implement a 'write' function in pdp-11 / MACRO-11 / ODT using simh?

So, I'm working on a project where I'm aiming to get the first winner of the IOCCC (obfuscated c code contest) dissected down to the last detail... The program is mullender.c which you can find by ...
2
votes
2answers
107 views

PDP-1 skip group invert bit functionality

I'm confused on the behavior of setting the invert bit on the PDP-1's SKP group. The manual states: The intent of any skip instruction can be reversed by making Bit 5 (normally the Indirect Address ...
13
votes
2answers
1k views

Origin of “arithmetic” and “logical” for signed and unsigned shifts

The assembly language for many processors use the phrase "arithmetic shift" to represent the bitwise shift of a signed value, and "logical shift" for an unsigned value. The two ...
4
votes
3answers
181 views

Apple II: ProDOS, zero length prefix and MLI calls

I have a simple program on my Apple IIc written in assembly language. It starts by getting a filename from the user (just the file name, not the full path), then it opens the corresponding file with a ...
12
votes
1answer
757 views

Difference between INT 0x20 and INT 0x21 (0x4C)?

Checking the MS-DOS interrupt list we see INT 0x20 "Terminate the program" (see https://en.wikipedia.org/wiki/DOS_API) but if we check the same page we see INT 0x21 with function 0x4C will &...
11
votes
3answers
1k views

How can I access/use memory outside of the standard 1 MB address range of MS-DOS?

How do you access more memory (above the 1MB) in DOS if the 640KB of conventional memory are not enough? I have read a lot about this, but I couldn't figure out how to do this in actual code. Is ...
23
votes
12answers
7k views

Was memory corruption a common problem in large programs written in assembly language?

Memory corruption bugs have always been a common problem in large C programs and projects. It was a problem in 4.3BSD back then, and it's still a problem today. No matter how carefully the program is ...
14
votes
1answer
520 views

SYSENTER/SYSEXIT broken on Pentium Pro and Pentium II?

I was just reading What is linux-gate.so.1?, and it says this: Intel recognized this problem early on and introduced a more efficient system call interface in the form of sysenter and sysexit ...
4
votes
2answers
411 views

The use of segments in non-relocating assemblers

I've been looking at a bunch of different 6502 assemblers recently (dasm, ca65, xa, kickass), and many of them have support for multiple code segments. Some of these assemblers can generate ...
0
votes
3answers
346 views

How was “Super Mario Bros” made with Assembly if the DASM compiler came out in 1987?

Would somebody care to explain how "Super Mario Bros." was released in 1985. But the DASM Assembler came out in 1987? The 6502 Assembly language was introduced in 1975. How would you compile/...
2
votes
1answer
85 views

Defining zeropage address labels in xa assembler?

I am trying to use the xa assembler to write some 6502 code. According to the documentation, I can define a zeropage segment using the .zero pseudo-op. I was hoping to do something like this: .zero ...
4
votes
2answers
648 views

Z80 PIO Keyboard [closed]

I am working on designing a Z80 computer and I would like to use a PS/2 Keyboard for input. I would like to use a PIO to communicate with it, but I am having trouble finding any documentation online ...
5
votes
2answers
296 views

Mysterious things happening to stack when running a debug session

When I run a debug session using FreeDOS and DEBUG.EXE, I get a session like the following. I've added a description of what I saw as annotation on the image. Each step, I've printed out the stack ...
14
votes
1answer
1k views

How can a Z80 assembly program find out the address stored in the SP register?

I'm wondering how to write a program in Z80 assembler that discovers the value stored in the SP register. From what I've seen, the only instructions that touch the SP register are: LD SP, HL/IX/IY EX ...
5
votes
4answers
416 views

Better way to do Z80 “bank switch & call”?

I have a memory setup where the whole address space can be exchanged (default 2 slots with 2 banks each, but may change depending on "expansion cards" plugged in). Banks are switched by ...
11
votes
1answer
1k views

Identifying this 6502 Assembler

I found some 6502 assembler code for a Commodore 64 program that uses meta commands like #include "foobar", define the address to be assembled to via *=$1234 and define labels without a colon. ...
5
votes
1answer
360 views

Why is my program outputting only zeros to the data bus during I/O operations?

I'm building a breadboard Z80-based computer. As now, I have the CPU hooked up to an EEPROM and an I/O device (an HD44780 character display) with appropriate decoding logic. The ROM chip starts at ...
9
votes
3answers
982 views

Make the “z80asm” assembler place an instruction at a known memory address

I'm writing a very basic OS for my homebrew Z80 computer. As an absolute assembly language beginner, I managed to obtain a working "os plus memory monitor" that can show memory content and ...
0
votes
3answers
208 views

c64 copy chars to sprite issue

How to do correct copying char to sprite ? Lets say 1st char is at $2000 second is at $2008 and copying to sprite at $2480. And with this we can copy 1 char to top left position of 1st sprite. But ...
22
votes
1answer
1k views

When did the IBM 650 have a “Table lookup on Equal” instruction?

In 1959, Donald Knuth wrote an assembly program named SuperSoap for the IBM 650. Here is the manual, and here is a listing of the program (in SuperSoap assembly language). Quoting from the abstract: ...
1
vote
0answers
64 views

Run ca65 assembler with intermediate step of resolving macros

I would like to convert an assembler program in ca65 with macros into assembler code with resolved macros in order to carry out manual or automatic optimizations with the resulting code. Then, the ...
14
votes
5answers
4k views

Was Family BASIC for the NES/Famicom powerful enough to create full games and applications?

"Family BASIC or Famicom BASIC is the consumer product for programming Nintendo's Family Computer video game console of Japan." wikipedia I can't seem to find much info about Family BASIC ...
4
votes
3answers
2k views

8086 duration of program

I have the following assembly code for 8086 MOV AL, [BX] OUT DX, AL The bus clock frequency is 1MHz. Access to memory is done without WAIT, and to I/O with one WAIT tick. How I can calculate the ...
4
votes
2answers
203 views

Were there “higher level programming” macro packages for the IBM Macro Assembler?

The IBM/360 Macro Assembly language was quite powerful, allowing non-trivial compile-time string manipulation. Did macro packages exist which would facilitate programming at a (slightly) higher level, ...
34
votes
14answers
8k views

What “unusual” syntax assembly languages are/were there?

This question may have the apparent form of a question soliciting a "list" answer, but I'm expecting the list to be very short, so please bear with me. What "unusual" syntax assembly languages are/...
61
votes
13answers
15k views

Were later MS-DOS versions still implemented in x86 assembly?

Recently, Microsoft published the source code of old MS-DOS versions on GitHub. What is odd in my opinion is the use of x86 assembly language for everything. The assembly language would not be my ...
6
votes
1answer
548 views

Putting code into two different memory areas with cc65/ca65

According to cc65 / ca65 documentation, the .org directive does not affect the placement of the code unlike with other 6502 assemblers. The docs suggest defining a memory segment with the intended ...
17
votes
1answer
538 views

Where and when did the “.s” suffix for assembly-language source files originate?

The closest I was able to find on StackOverflow is What are .S files?, in which no answerer addresses why we use .s for assembly. (And .S for preprocessor/macro assembly; and gcc -S to produce ...
1
vote
2answers
311 views

Performing 16-bit port I/O on the RTC

Why can’t the RTC (0x70, 0x71) read and write 16 bits at a time? For example: mov ax, 0xa8f out 0x70, ax I have found in a 286 BIOS that did this (BIOS ID string: S286-6181-...
9
votes
5answers
2k views

Is there a way to link object files for DOS from Linux?

I'm able to use NASM to assemble simple COM files from my modern Linux computer, but how can I create a DOS EXE file while still in Linux? Specifically, I am interested in a solution that will target ...
21
votes
2answers
1k views

What are these tiny TSRs doing?

I've been puzzled by this for a while now. The (very old) game Phantasie comes with three small TSRs that are run prior to running the main game executable. This is the content of the file PH.BAT, ...
4
votes
2answers
119 views

6800 I flag at reset

I have written an emulation of the Heathkit ET-3400A microcomputer trainer in Java, mainly to see if I could do it and to get my feet wet in Java. Odd question, but there's a discrepancy (one of many,...
3
votes
2answers
430 views

How were games and programs written for the C64 in assembler in the 80s? [duplicate]

Were developers using monitors like e.g. "Supermon+64", "Merlin 64" or "Monitor$C000" and cartridges like "Final Cartridge", "Action Replay" (both of ...
6
votes
3answers
431 views

Did the Apollo Guidance Computer or other multi-ROM machines subdivide code between ROM chips/modules to facilitate partial updates?

The Apollo Guidance Computer had its code stored in six modules that held 6 kwords of storage each, and the design of each module was such that changing even a single bit after construction would have ...
5
votes
2answers
324 views

Commodore Plus/4 jiffy clock tied to screen refresh frequency? (warning: flashing images)

Warning: There are flashing images below, do not scroll down if you are sensitive to them! According to various sources (for example this for the Plus/4), both the C64 and Plus/4 have a "jiffy&...