{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreie4mzjy76jmmfxzihlbptlw5sjawffe4fuclzuarccssdumpelciy",
    "uri": "at://did:plc:nmehtch5e3g5hp3hwxvfkqpy/app.bsky.feed.post/3mlhuna3h5oe2"
  },
  "path": "/news/323/gcc-for-asm-experts-and-c-c-intermediates-part-6",
  "publishedAt": "2026-05-08T16:27:01.000Z",
  "site": "https://news.scene.org",
  "tags": [
    "GCC for asm Experts (and C/C++ Intermediates) - Part 6",
    "← Fixing Post-Increment Addressing"
  ],
  "textContent": "[ **Atariscne.org - News** ] GCC for asm Experts (and C/C++ Intermediates) - Part 6\n\n← Fixing Post-Increment Addressing\n\n**DBRA and the Cost Model Balancing Act**\n\nWhen you write assembly for the m68k, dbra is just _there_. Put your count in a data register, end your loop with dbra dN,.label. Four bytes, twelve cycles per iteration on 68000, no flag dance, no comparison. Your loops naturally form around the instruction.\n\nC/C++ does not work that way. The natural loop in C is for (i = 0; i < N; i++) or while (cond). Neither says \"count down and exit when you wrap\", well, while can. But a counted-up loop with an unsigned comparison is what the language naturally models, and that is what GIMPLE mostly produces. Turning that into a dbra is a backend job, and requires carefully written code. And GCC, for reasons we will get to, mostly stopped doing it for m68k.",
  "title": "GCC for asm Experts (and C/C++ Intermediates) - Part 6"
}