# MACRO-80 Assembler

- Manual: [M80 Assembler.pdf](https://wiki.hexadust.net/attachments/38)
- Linker: [Microsoft L80 Linker.pdf](https://wiki.hexadust.net/attachments/39)

## Compiling

### Using prompt

Run with `M80`; prompts for file names in format:

```
[[out-dev:]out-file[.ext]][,[lit-dev:]list-file[.ext]]=[in-dev:]in-file[.ext][/options]
```

Try `=example` to compile `example.mac` file. Use `CTRL+C` to exit to CP/M.

### Using arguments

For example compile Z80 assembly `hello.mac`:

```
D:m80 =hello.mac/Z
```

Compile printing listing:

```
D:M80 ,TTY:=hello/Z
```

Compile and save listing to `.PRN` file:

```
D:M80 =hello/L
```

### Errors

<table border="1" id="bkmrk-a-argument-error" style="border-collapse: collapse; width: 100%; height: 116.933px; border-width: 0px;"><colgroup><col style="width: 50.0397%;"></col><col style="width: 50.0397%;"></col></colgroup><tbody><tr style="height: 29.7833px;"><td class="align-right" style="height: 29.7833px; border-width: 0px;">`A`</td><td style="height: 29.7833px; border-width: 0px;">Argument error</td></tr><tr style="height: 29.4667px;"><td class="align-right" style="height: 29.4667px; border-width: 0px;">`C`  
</td><td style="height: 29.4667px; border-width: 0px;">Undefined symbol</td></tr><tr style="height: 28.8833px;"><td class="align-right" style="border-width: 0px; height: 28.8833px;">`N`  
</td><td style="border-width: 0px; height: 28.8833px;">Number error</td></tr><tr style="height: 28.8px;"><td class="align-right" style="border-width: 0px; height: 28.8px;">`U`</td><td style="border-width: 0px; height: 28.8px;">Undefined; Note: `B0h` gives `U`, try `0B0h` instead</td></tr></tbody></table>

## Linker

Link and create `.COM` file:

```
D:L80 HELLO,HELLO/N/E
```